package cn.edu.xbu.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;

@WebFilter(urlPatterns="/*")
public class anythingFilter implements Filter{

	@Override
	public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
			throws IOException, ServletException {
		System.out.println("["+this+"]正在執行過濾");
		
		chain.doFilter(req,resp);//將請求和響應 向後傳遞
	}
	public void init(FilterConfig config)throws ServletException{
		System.out.println("["+this+"]初始化"+config.getFilterName());
	}
	public void destroy() {
		System.out.println("["+this+"]銷毀");
	}

}
